<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Article extends Model
{
    //
    use SoftDeletes;
    public static $catid = ['47','25','26','27','28','29'];
    
    public function category()
    {
        return $this->belongsTo('App\Models\Category','post_type','id');
    }
    public function user()
    {
        return \DB::table('admin_users')
                    ->where('id', $this->post_author)
                    ->select('id', 'name')
                    ->first();;
    }
    public function buys()
    {
        return $this->hasOne(Buy::class, 'item_id', 'id');
    }
}
